package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@WebServlet("/Gss")
public class GetsessionServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession();
		String yhm = (String) session.getAttribute("yhm");
		String pwd = (String) session.getAttribute("pwd");
		response.setContentType("text/html;charset=utf-8");
		response.getWriter().append("yhm").append(":").append(yhm+"<br>");
		response.getWriter().append("pwd").append(":").append(pwd);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		doGet(request, response);
	}

}
